﻿<%--<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Models.TrainingsSchedules>" %>--%>
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<CRM.Database.Model.TrainingsSchedules>" %>

<%
    var placesCol = new CRM.Database.Model.TrainingsPlacesCollection(); 
%>

<%
    Html.DevExpress().ComboBox(settings =>
                                   {
                                       settings.Name = "IdTrainingsPlace";
                                       settings.CallbackRouteValues = new {Controller = "TC", Action = "TrainingsSchedulesEditPlacesPartial"};
                                       settings.Properties.ValueType = typeof (int);
                                       settings.Properties.TextField = "NameRu";
                                       settings.Properties.ValueField = "IdTrainingsPlace";
                                       settings.Width = 300;
                                       settings.Properties.EnableCallbackMode = true;
                                       settings.Properties.ClientSideEvents.BeginCallback = "function(s, e) { e.customArgs['Country'] = IdTrainingsCource.GetValue(); }";
                                       if (!(Model.IdTrainingsSchedule > 0))
                                           settings.Properties.ClientSideEvents.EndCallback ="function(s, e) {IdTrainingCoursesType.PerformCallback();}";
                                   }).BindList(placesCol.GetPlacesListByCourseId(Model.IdTrainingsCource)).Bind(Model.IdTrainingsPlace).GetHtml();
//}).BindList(DB.GetTrainingsPlacesListByCourse(DB.GetTrainingsCoursebyId(Model.IdTrainingsCource)).OrderBy(p=>p.NameRu)).Bind(Model.IdTrainingsPlace).GetHtml()
%>